home *** CD-ROM | disk | FTP | other *** search
-
- /*
- * Simple test of the animation subsystem.
- */
-
- package sub_arctic.test;
-
- import sub_arctic.lib.*;
- import sub_arctic.output.*;
- import sub_arctic.input.*;
- import sub_arctic.anim.*;
-
- import java.awt.Point;
- import java.awt.Font;
-
- public class anim_test extends interactor_applet implements callback_object {
-
- public void build_ui(base_parent_interactor tl) {
- long now=time_interval.now();
-
- pacer p1=new slow_in_slow_out(0.35,0.2);
-
- anticipation_line lt1=new anticipation_line(300,100,100,100,p1);
- anticipation_line lt2=new anticipation_line(100,100,300,100,p1);
- anticipation_line lt3=new anticipation_line(50,50,320,320,p1);
-
- time_interval ti=new time_interval(now+4000,now+4000+4000),after,same;
- label thelabel,otherlabel;
- anim_mover_container sc,sc2;
- transition t,t2,t3;
-
- /* make the labels */
- thelabel=new label("Watch This!",
- new Font("Helvetica",Font.BOLD,16));
- otherlabel=new label("Watch Me Too!",
- new Font("Helvetica",Font.BOLD,16));
- /* put the label in a sprite container ... only the first interactor
- gets the callbacks*/
- sc=new anim_mover_container(100,100,thelabel,this);
- /* make another container for the other label */
- sc2=new anim_mover_container(50,50,otherlabel);
- /* make a transition */
- t=new transition(sc,ti,lt2);
- /* create another transition that is 2 secs after t */
- after=new time_interval(time_interval.AFTER_END_OF,
- t,2000);
- after.set_duration(3000);
- t2=new transition(sc,after,lt1);
- /*another transition that starts at same time as t*/
- same=new time_interval(time_interval.AFTER_START_OF,t,
- 0);
- same.set_duration(5000);
-
- t3=new transition(sc2,same,lt3);
- /* set the transition onto the main sprite container */
- sc.set_transition(t);
- sc.set_transition(t2);
- /* put the one on the other sprite container */
- sc2.set_transition(t3);
- /* put the whole thing in the toplevel */
- tl.add_child(sc);
- tl.add_child(sc2);
- }
- public void callback(interactor from_obj, event evt,
- int callback_num, Object info) {
- System.out.println("Callback called: number is " + callback_num);
- }
-
- }
-
-
-
-
-
- /*=========================== COPYRIGHT NOTICE ===========================
-
- This file is part of the subArctic user interface toolkit.
-
- Copyright (c) 1996 Scott Hudson and Ian Smith
- All rights reserved.
-
- The subArctic system is freely available for most uses under the terms
- and conditions described in
- http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html
- and appearing in full in the lib/interactor.java source file.
-
- The current release and additional information about this software can be
- found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
-
- ========================================================================*/
-